Skip to content

fix: installer Python detection visibility (#11) and stale hook cleanup (#12)#20

Merged
StuBehan merged 2 commits into
StackOneHQ:mainfrom
StuBehan:fix/installer-stale-hooks-python-detection
Apr 30, 2026
Merged

fix: installer Python detection visibility (#11) and stale hook cleanup (#12)#20
StuBehan merged 2 commits into
StackOneHQ:mainfrom
StuBehan:fix/installer-stale-hooks-python-detection

Conversation

@StuBehan
Copy link
Copy Markdown
Collaborator

Summary

Closes #11 and #12 — both small installer fixes.

#11 — silent Python <3.10 install failure. The "Could not find Python ≥ 3.10" exit message used to scroll past behind ~120 lines of UserNotifications Swift deprecation warnings emitted during the build step.

  • Redirect `build.sh` stdout+stderr to `/tmp/stack-nudge-install-build.log`; on real build failure, dump the last 20 lines so genuine errors stay visible while routine warnings stop drowning the transcript.
  • Surround the Python error with blank lines + a ✗ marker, and spell out both fix paths (`brew install python@3.13` vs `STACKNUDGE_PYTHON` env var).
  • Document the Python ≥ 3.10 prerequisite at the top of the README's Install section so the requirement is visible before the user runs `install.sh`.

#12 — stale hook entries on upgrade. Prior installs at different paths (legacy `~/.tinynudge/notify.sh`, moved checkouts, etc.) used to leave duplicate hook entries pointing at dead paths because the dedupe check matched the current `$NOTIFY` path exactly.

  • Match any path inside a tinynudge or stack-nudge directory using `(?:^|/).?(?:tinynudge|stack-nudge)/notify.sh(?:\s|$)` — catches `/.tinynudge`, `/.stack-nudge`, `/dev/checkout/stack-nudge`, etc., while leaving unrelated hooks (other tools, mixed groups) intact.
  • Applied symmetrically in `install.sh` (Claude + Cursor blocks) and `uninstall.sh`.

Test plan

  • `shellcheck --severity=warning install.sh uninstall.sh` passes
  • `bash -n install.sh && bash -n uninstall.sh` passes
  • Regex smoketest: 9 boundary cases (`.tinynudge`, `.stack-nudge`, dev checkout, `.stack-nudge-other`, `stack-nudgey`, `notify.shx`, empty, etc.) all pass
  • Synthetic install simulation: stale `.tinynudge` Stop entry dropped, unrelated hook preserved, mixed group's stack-nudge inner hook stripped without losing unrelated siblings, fresh entry appended
  • Manual: run `./install.sh` on a clean machine where only `/usr/bin/python3` (3.9) is available — confirm error is now visible
  • Manual: hand-craft a `/.claude/settings.json` with a stale `/.tinynudge/notify.sh` entry, run `./install.sh`, confirm only one entry remains

StuBehan and others added 2 commits April 30, 2026 22:42
The "Could not find Python ≥ 3.10" exit message used to scroll past behind
~120 lines of UserNotifications Swift deprecation warnings emitted during
the build step, so anyone tailing the install output just saw a non-zero
exit with no actionable hint.

- Redirect build.sh stdout+stderr to /tmp/stack-nudge-install-build.log;
  on real build failure, dump the last 20 lines so genuine errors stay
  visible while routine warnings stop drowning the transcript.
- Surround the Python error with blank lines + a ✗ marker, and spell out
  both fix paths (brew install vs STACKNUDGE_PYTHON env var).
- Document the Python ≥ 3.10 prerequisite at the top of the README's
  Install section so the requirement is visible before the user runs
  install.sh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prior installs at different paths (legacy ~/.tinynudge/notify.sh, moved
checkouts, etc.) used to leave duplicate hook entries pointing at dead
paths, because the dedupe check matched the current $NOTIFY path
exactly.

Match any path inside a tinynudge or stack-nudge directory using
  (?:^|/)\.?(?:tinynudge|stack-nudge)/notify\.sh(?:\s|$)
which catches ~/.tinynudge, ~/.stack-nudge, /dev/checkout/stack-nudge,
etc. while leaving unrelated hooks (other tools, mixed groups) intact.

Applied symmetrically in install.sh (both Claude and Cursor blocks) and
uninstall.sh so upgrades and removals are both path-agnostic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@StuBehan StuBehan merged commit 3c9ed47 into StackOneHQ:main Apr 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install.sh fails silently when system Python is < 3.10 (error swallowed by Swift build warnings)

1 participant